import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_readium_demo/flutter_readium_demo.dart';
import 'package:flutter_readium_demo/flutter_readium_demo_platform_interface.dart';
import 'package:flutter_readium_demo/flutter_readium_demo_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterReadiumDemoPlatform
    with MockPlatformInterfaceMixin
    implements FlutterReadiumDemoPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterReadiumDemoPlatform initialPlatform = FlutterReadiumDemoPlatform.instance;

  test('$MethodChannelFlutterReadiumDemo is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterReadiumDemo>());
  });

  test('getPlatformVersion', () async {
    FlutterReadiumDemo flutterReadiumDemoPlugin = FlutterReadiumDemo();
    MockFlutterReadiumDemoPlatform fakePlatform = MockFlutterReadiumDemoPlatform();
    FlutterReadiumDemoPlatform.instance = fakePlatform;

    expect(await flutterReadiumDemoPlugin.getPlatformVersion(), '42');
  });
}
